<HTML>
<HEAD>
<!-- This HTML file has been created by texi2html 1.29
     from lidoref.tnf on 19 December 2010 -->

<TITLE>LIDO - Reference Manual - Predefined Entities</TITLE>
</HEAD>
<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000EE" VLINK="#551A8B" ALINK="#FF0000" BACKGROUND="gifs/bg.gif">
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0" VALIGN=BOTTOM>
<TR VALIGN=BOTTOM>
<TD WIDTH="160" VALIGN=BOTTOM>
<A HREF="http://eli-project.sourceforge.net/">
<IMG SRC="gifs/elilogo.gif" BORDER=0>
</A>&nbsp;
</TD>
<TD WIDTH="25" VALIGN=BOTTOM>
<img src="gifs/empty.gif" WIDTH=25 HEIGHT=25>
</TD>
<TD ALIGN=LEFT WIDTH="475" VALIGN=BOTTOM>
<A HREF="index.html"><IMG SRC="gifs/title.png" BORDER=0></A>
</TD>
<!-- |DELETE FOR SOURCEFORGE LOGO|
<TD>
<a href="http://sourceforge.net/projects/eli-project">
<img
  src="http://sflogo.sourceforge.net/sflogo.php?group_id=70447&amp;type=13"
  width="120" height="30"
  alt="Get Eli: Translator Construction Made Easy at SourceForge.net.
    Fast, secure and Free Open Source software downloads"/>
</a>
</TD>
|DELETE FOR SOURCEFORGE LOGO| -->
</TR>
</TABLE>

<HR size=1 noshade width=785 align=left>
<TABLE BORDER=0 CELLSPACING=2 CELLPADDING=0>
<TR>
<TD VALIGN=TOP WIDTH="160">
<h4>General Information</h4>

<table BORDER=0 CELLSPACING=0 CELLPADDING=0>
<tr valign=top><td><img src="gifs/gelbekugel.gif" WIDTH=7 HEIGHT=7 ALT=" o"> </td><td><a href="index.html">Eli: Translator Construction Made Easy</a></td></tr>
<tr valign=top><td><img src="gifs/gelbekugel.gif" WIDTH=7 HEIGHT=7 ALT=" o"> </td><td><a href="gindex_1.html#SEC1">Global Index</a></td></tr>
<tr valign=top><td><img src="gifs/gelbekugel.gif" WIDTH=7 HEIGHT=7 ALT=" o"> </td><td><a href="faq_toc.html" >Frequently Asked Questions</a> </td></tr>
<tr valign=top><td><img src="gifs/gelbekugel.gif" WIDTH=7 HEIGHT=7 ALT=" o"> </td><td><a href="ee.html" >Typical Eli Usage Errors</a> </td></tr>
</table>

<h4>Tutorials</h4>

<table BORDER=0 CELLSPACING=0 CELLPADDING=0>
<tr valign=top><td><img src="gifs/gelbekugel.gif" WIDTH=7 HEIGHT=7 ALT=" o"> </td><td><a href="EliRefCard_toc.html">Quick Reference Card</a></td></tr>
<tr valign=top><td><img src="gifs/gelbekugel.gif" WIDTH=7 HEIGHT=7 ALT=" o"> </td><td><a href="novice_toc.html">Guide For new Eli Users</a></td></tr>
<tr valign=top><td><img src="gifs/gelbekugel.gif" WIDTH=7 HEIGHT=7 ALT=" o"> </td><td><a href="news_toc.html">Release Notes of Eli</a></td></tr>
<tr valign=top><td><img src="gifs/gelbekugel.gif" WIDTH=7 HEIGHT=7 ALT=" o"> </td><td><a href="nametutorial_toc.html">Tutorial on Name Analysis</a></td></tr>
<tr valign=top><td><img src="gifs/gelbekugel.gif" WIDTH=7 HEIGHT=7 ALT=" o"> </td><td><a href="typetutorial_toc.html">Tutorial on Type Analysis</a></td></tr>
<tr valign=top><td><img src="gifs/gelbekugel.gif" WIDTH=7 HEIGHT=7 ALT=" o"> </td><td><a href="ee.html" >Typical Eli Usage Errors</a> </td></tr>
</table>

<h4>Reference Manuals</h4>

<table BORDER=0 CELLSPACING=0 CELLPADDING=0>
<tr valign=top><td><img src="gifs/gelbekugel.gif" WIDTH=7 HEIGHT=7 ALT=" o"> </td><td><a href="ui_toc.html">User Interface</a></td></tr>
<tr valign=top><td><img src="gifs/gelbekugel.gif" WIDTH=7 HEIGHT=7 ALT=" o"> </td><td><a href="pp_toc.html">Eli products and parameters</a></td></tr>
<tr valign=top><td><img src="gifs/gelbekugel.gif" WIDTH=7 HEIGHT=7 ALT=" o"> </td><td><a href="lidoref_toc.html">LIDO Reference Manual</a></td></tr>
<tr valign=top><td><img src="gifs/gelbekugel.gif" WIDTH=7 HEIGHT=7 ALT=" o"> </td><td><a href="ee.html" >Typical Eli Usage Errors</a> </td></tr>
</table>

<h4>Libraries</h4>

<table BORDER=0 CELLSPACING=0 CELLPADDING=0>
<tr valign=top><td><img src="gifs/gelbekugel.gif" WIDTH=7 HEIGHT=7 ALT=" o"> </td><td><a href="lib_toc.html">Eli library routines</a></td></tr>
<tr valign=top><td><img src="gifs/gelbekugel.gif" WIDTH=7 HEIGHT=7 ALT=" o"> </td><td><a href="modlib_toc.html">Specification Module Library</a></td></tr>
</table>

<h4>Translation Tasks</h4>

<table BORDER=0 CELLSPACING=0 CELLPADDING=0>
<tr valign=top><td><img src="gifs/gelbekugel.gif" WIDTH=7 HEIGHT=7 ALT=" o"> </td><td><a href="lex_toc.html">Lexical analysis specification</a></td></tr>
<tr valign=top><td><img src="gifs/gelbekugel.gif" WIDTH=7 HEIGHT=7 ALT=" o"> </td><td><a href="syntax_toc.html">Syntactic Analysis Manual</a></td></tr>
<tr valign=top><td><img src="gifs/gelbekugel.gif" WIDTH=7 HEIGHT=7 ALT=" o"> </td><td><a href="comptrees_toc.html">Computation in Trees</a></td></tr>
</table>

<h4>Tools</h4>

<table BORDER=0 CELLSPACING=0 CELLPADDING=0>
<tr valign=top><td><img src="gifs/gelbekugel.gif" WIDTH=7 HEIGHT=7 ALT=" o"> </td><td><a href="lcl_toc.html">LIGA Control Language</a> </td></tr>
<tr valign=top><td><img src="gifs/gelbekugel.gif" WIDTH=7 HEIGHT=7 ALT=" o"> </td><td><a href="show_toc.html">Debugging Information for LIDO</a> </td></tr>
<tr valign=top><td><img src="gifs/gelbekugel.gif" WIDTH=7 HEIGHT=7 ALT=" o"> </td><td><a href="gorto_toc.html">Graphical ORder TOol</a> </td></tr>
</table>
<p>
<table BORDER=0 CELLSPACING=0 CELLPADDING=0>
<tr valign=top><td><img src="gifs/gelbekugel.gif" WIDTH=7 HEIGHT=7 ALT=" o"> </td><td><a href="fw_toc.html">FunnelWeb User's Manual</a> </td></tr>
</table>
<p>
<table BORDER=0 CELLSPACING=0 CELLPADDING=0>
<tr valign=top><td><img src="gifs/gelbekugel.gif" WIDTH=7 HEIGHT=7 ALT=" o"> </td><td><a href="ptg_toc.html">Pattern-based Text Generator</a> </td></tr>
<tr valign=top><td><img src="gifs/gelbekugel.gif" WIDTH=7 HEIGHT=7 ALT=" o"> </td><td><a href="deftbl_toc.html">Property Definition Language</a> </td></tr>
<tr valign=top><td><img src="gifs/gelbekugel.gif" WIDTH=7 HEIGHT=7 ALT=" o"> </td><td><a href="oil_toc.html">Operator Identification Language</a> </td></tr>
<tr valign=top><td><img src="gifs/gelbekugel.gif" WIDTH=7 HEIGHT=7 ALT=" o"> </td><td><a href="tp_toc.html">Tree Grammar Specification Language</a> </td></tr>
<tr valign=top><td><img src="gifs/gelbekugel.gif" WIDTH=7 HEIGHT=7 ALT=" o"> </td><td><a href="clp_toc.html">Command Line Processing</a> </td></tr>
<tr valign=top><td><img src="gifs/gelbekugel.gif" WIDTH=7 HEIGHT=7 ALT=" o"> </td><td><a href="cola_toc.html">COLA Options Reference Manual</a> </td></tr>
</table>
<p>
<table BORDER=0 CELLSPACING=0 CELLPADDING=0>
<tr valign=top><td><img src="gifs/gelbekugel.gif" WIDTH=7 HEIGHT=7 ALT=" o"> </td><td><a href="idem_toc.html">Generating Unparsing Code</a> </td></tr>
</table>
<p>
<table BORDER=0 CELLSPACING=0 CELLPADDING=0>
<tr valign=top><td><img src="gifs/gelbekugel.gif" WIDTH=7 HEIGHT=7 ALT=" o"> </td><td><a href="mon_toc.html">Monitoring a Processor's Execution</a> </td></tr>
</table>

<h4>Administration</h4>

<table BORDER=0 CELLSPACING=0 CELLPADDING=0>
<tr valign=top><td><img src="gifs/gelbekugel.gif" WIDTH=7 HEIGHT=7 ALT=" o"> </td><td><a href="sysadmin_toc.html">System Administration Guide</a> </td></tr>
</table>

<HR WIDTH="100%">
<A HREF="mailto:eli-project-users@lists.sourceforge.net">
<IMG SRC="gifs/button_mail.gif" BORDER=0 ALIGN="left"></A>
<A HREF="index.html"><IMG SRC="gifs/home.gif" BORDER=0 ALIGN="right"></A>

</TD>
<TD VALIGN=TOP WIDTH="25"><img src="gifs/empty.gif" WIDTH=25 HEIGHT=25></TD>

<TD VALIGN=TOP WIDTH="600">
<H1>LIDO - Reference Manual</H1>
<P>
<IMG SRC="gifs/empty.gif" WIDTH=25 HEIGHT=25 ALT=""><A HREF="lidoref_11.html"><IMG SRC="gifs/prev.gif" ALT="Previous Chapter" BORDER="0"></A>
<IMG SRC="gifs/empty.gif" WIDTH=25 HEIGHT=25 ALT=""><A HREF="lidoref_13.html"><IMG SRC="gifs/next.gif" ALT="Next Chapter" BORDER="0"></A>
<IMG SRC="gifs/empty.gif" WIDTH=25 HEIGHT=25 ALT=""><A HREF="lidoref_toc.html"><IMG SRC="gifs/up.gif" ALT="Table of Contents" BORDER="0"></A>
<IMG SRC="gifs/empty.gif" WIDTH=25 HEIGHT=25 ALT="">
<HR size=1 noshade width=600 align=left>
<H1><A NAME="SEC21" HREF="lidoref_toc.html#SEC21">Predefined Entities</A></H1>
<P>
The names described in this chapter have a predefined meaning
in LIDO specifications.
<A NAME="IDX235"></A>
<P>
The following types are predefined in LIDO:
<A NAME="IDX237"></A>
<A NAME="IDX238"></A>
<A NAME="IDX239"></A>
<A NAME="IDX236"></A>
<P>
<DL COMPACT>
<DT><CODE>VOID</CODE>
<DD>Attributes of this type describe a computational state without
propagating values between computations. Those attributes do not
occur as data objects in the generated evaluator.
<P>
<DT><CODE>int</CODE>
<DD>The terminal type.
<P>
<DT><CODE>NODEPTR</CODE>
<DD>Attributes of this type represent computed subtrees.
</DL>
<P>
The predefined value <CODE>NULLNODEPTR</CODE> of type <CODE>NODEPTR</CODE>
denotes no tree.
<A NAME="IDX240"></A>
<P>
The <CODE>CLASS</CODE> symbol <CODE>ROOTCLASS</CODE> is predefined.
It is implicitly inherited by the root of the tree grammar
(see  <A HREF="lidoref_4.html#SEC5">Symbol Specifications</A>).
<P>
The following attribute is predefined in LIDO:
<A NAME="IDX242"></A>
<A NAME="IDX241"></A>
<P>
<DL COMPACT>
<DT><CODE>GENTREE</CODE>
<DD>Every insertion point symbol has an attribute <CODE>GENTREE</CODE> of
type <CODE>NODEPTR</CODE>.
</DL>
<P>
The following functional notations have a specific meaning in LIDO.
They are translated into suitable C constructs rather than into
function calls:
<P>
<DL COMPACT>
<DT><CODE>IF (a, b, c)</CODE>
<DD>denotes a conditional expression.
At runtime either <CODE>b</CODE> or <CODE>c</CODE> is evaluated, if <CODE>a</CODE>
yields a non-zero or a zero value. 
For determination of the static evaluation order
each of <CODE>a, b, c</CODE> contribute to the precondition of the
computation that contains the <CODE>IF</CODE> construct.
If it occurs in value context 
<CODE>b</CODE> and <CODE>c</CODE> are in value context, too.
Then <CODE>b</CODE> and <CODE>c</CODE> have to yield values of the same type
(not checked by LIGA). Otherwise <CODE>b</CODE> and <CODE>c</CODE> are
in <CODE>VOID</CODE> context and may or may not yield a value of some type.
<P>
<DT><CODE>IF (a, b)</CODE>
<DD>is a conditional computation of
<CODE>b</CODE>, which is executed only if <CODE>a</CODE> yields a non-zero value.
For determination of the static evaluation order
both <CODE>a</CODE> and <CODE>b</CODE> contribute to the precondition of the
computation that contains the <CODE>IF</CODE> construct.
This <CODE>IF</CODE> construct must occur in <CODE>VOID</CODE> context.
<CODE>b</CODE> is in VOID context, too.
<A NAME="IDX243"></A>
<P>
<DT><CODE>ORDER (a, b, ..., x)</CODE>
<DD>The arguments are evaluated in the specified order. 
If it occurs in <CODE>VOID</CODE> 
context all arguments are in <CODE>VOID</CODE> context. 
If it occurs in value context it yields the result of the 
last argument <CODE>x</CODE>.
The others are in <CODE>VOID</CODE> context and may or may not yield a value.
For determination of the static evaluation order
all arguments of the <CODE>ORDER</CODE> construct contribute to the
precondition of the computation containing it.
Any nesting of <CODE>ORDER</CODE>, <CODE>IF</CODE>, function calls, 
and other expressions is
allowed, as long as the stated conditions for <CODE>VOID</CODE> and value
contexts hold.
<A NAME="IDX244"></A>
<P>
<DT><CODE>RuleFct (C_String, arguments ...)</CODE>
<DD>A call of this function is substituted by a call 
of a function whose name is composed of the <CODE>C_String</CODE> and
the name of the rule that has (or inherits) this call.
The remaining arguments are taken as arguments of the substituted
call. E.g. in a rule named <CODE>rBlock</CODE> a call
<CODE>RuleFct ("PTG", a, b)</CODE> is substituted by
<CODE>PTGrBlock (a, b)</CODE>.
<A NAME="IDX245"></A>
<P>
<DT><CODE>RhsFct (C_String, arguments ...)</CODE>
<DD>A call of this function is substituted by a call
of a function whose name is composed of the <CODE>C_String</CODE> and
and two numbers that indicate how many nonterminals and terminals
are on the right-hand side of the rule that has (or inherits) this call.
The remaining arguments are taken as arguments of the substituted
call. E.g. in a rule <CODE>RULE: X ::= Id Y Id Z Id END;</CODE>,
where <CODE>Y, Z</CODE> are nonterminals, and <CODE>Id</CODE> is a terminal,
a call <CODE>RhsFct ("PTGChoice", a, b)</CODE> is substituted by
<CODE>PTGChoice_2_3 (a, b)</CODE>.
Usually, <CODE>RhsFct</CODE> will be used in symbol computations,
having arguments that are obtained by the <CODE>RHS</CODE> construct and
by a <CODE>TermFct</CODE> call.
<A NAME="IDX246"></A>
<P>
<DT><CODE>TermFct (C_String, arguments ...)</CODE>
<DD>A call of this function is substituted by a comma separated
sequence of calls 
of functions whose names are composed of the <CODE>C_String</CODE> and
the name of the non-literal terminals in the rule
that has (or inherits) this call.
The remaining arguments are taken as arguments of the substituted
calls. E.g. the following symbol computation
<PRE>
  SYMBOL X COMPUTE
    SYNT.Ptg = f (TermFct ("ToPtg", TERM));
  END;
  RULE: X ::= Y Number Z Ident ';' END;
</PRE>
yields the following rule computation
<PRE>
  RULE: X ::= Y Number Z Ident ';' COMPUTE
    X.Ptg = f (ToPtgNumber (Number), ToPtgIdent (Ident));
  END;
</PRE>
The order of the calls corresponds to the order of the terminals
in the rule. The <CODE>TermFct</CODE> call must occur on argument
position if there is more than one terminal in the rule.
<A NAME="IDX247"></A>
</DL>
<P>
The following names can be used in computations to obtain
values that are specific for the context in the abstract tree
in which the computation occurs:
<P>
<DL COMPACT>
<DT><CODE>LINE</CODE>
<DD>the source line number of the tree context.
<A NAME="IDX248"></A>
<DT><CODE>COL</CODE>
<DD>the source column number of the tree context.
<A NAME="IDX249"></A>
<DT><CODE>COORDREF</CODE>
<DD>the address of the source coordinates of the tree context,
to be used for example in calls of the message routine of 
the error module or in calls of tree construction functions.
<A NAME="IDX250"></A>
<DT><CODE>RULENAME</CODE>
<DD>a string literal for the rule name of the tree context,
to be used for example in symbol computations.
<A NAME="IDX251"></A>
</DL>
<P>
Note: These names are translated by LIGA into specific constructs of the
evaluator. Hence, they can not be used with this meaning in macros
that are expanded when the evaluator is translated.
(That was allowed in previous versions of LIGA.)
<P>
The following C macros are defined as described for the generated 
evaluator, and can be used in the LIDO text:
<P>
<PRE>
   APPLY (f, a, ... )  (*f) (a, ... )   a call of the function <CODE>f</CODE>
                                        with the remaining arguments

   CAST(tp,ex)         ( (tp) (ex) )
   SELECT(str,fld)     ( (str).fld )
   PTRSELECT(str,fld)  ( (str)-&#62;fld )
   INDEX(arr,indx)     ( (arr)[indx] )

   ADD(lop,rop)        ( lop + rop )
   SUB(lop,rop)        ( lop - rop )
   MUL(lop,rop)        ( lop * rop )
   DIV(lop,rop)        ( lop / rop )
   MOD(lop,rop)        ( lop % rop )
   NEG(op)             ( -op )

   NOT(op)             ( !op )
   AND(lop,rop)        ( lop &#38;&#38; rop )
   OR(lop,rop)         ( lop || rop )

   BITAND(lop,rop)     ( lop &#38; rop )
   BITOR(lop,rop)      ( lop | rop )
   BITXOR(lop,rop)     ( lop ^ rop )

   GT(lop,rop)         ( lop &#62; rop )
   LT(lop,rop)         ( lop &#60; rop )
   EQ(lop,rop)         ( lop == rop )
   NE(lop,rop)         ( lop != rop )
   GE(lop,rop)         ( lop &#62;= rop )
   LE(lop,rop)         ( lop &#60;= rop )

   VOIDEN(a)           ((void)a)

   IDENTICAL(a)        (a)
   ZERO()              0  
   ONE()               1
   ARGTOONE(x)         1
</PRE>
The last four macros are especially useful in 
<CODE>WITH</CODE> clauses of <CODE>CONSTITUENTS</CODE> constructs.
<A NAME="IDX253"></A>
<A NAME="IDX254"></A>
<A NAME="IDX255"></A>
<A NAME="IDX256"></A>
<A NAME="IDX257"></A>
<A NAME="IDX258"></A>
<A NAME="IDX259"></A>
<A NAME="IDX260"></A>
<A NAME="IDX261"></A>
<A NAME="IDX262"></A>
<A NAME="IDX263"></A>
<A NAME="IDX264"></A>
<A NAME="IDX265"></A>
<A NAME="IDX266"></A>
<A NAME="IDX267"></A>
<A NAME="IDX268"></A>
<A NAME="IDX269"></A>
<A NAME="IDX270"></A>
<A NAME="IDX271"></A>
<A NAME="IDX272"></A>
<A NAME="IDX273"></A>
<A NAME="IDX274"></A>
<A NAME="IDX275"></A>
<A NAME="IDX252"></A>
<P>
<HR size=1 noshade width=600 align=left>
<P>
<IMG SRC="gifs/empty.gif" WIDTH=25 HEIGHT=25 ALT=""><A HREF="lidoref_11.html"><IMG SRC="gifs/prev.gif" ALT="Previous Chapter" BORDER="0"></A>
<IMG SRC="gifs/empty.gif" WIDTH=25 HEIGHT=25 ALT=""><A HREF="lidoref_13.html"><IMG SRC="gifs/next.gif" ALT="Next Chapter" BORDER="0"></A>
<IMG SRC="gifs/empty.gif" WIDTH=25 HEIGHT=25 ALT=""><A HREF="lidoref_toc.html"><IMG SRC="gifs/up.gif" ALT="Table of Contents" BORDER="0"></A>
<IMG SRC="gifs/empty.gif" WIDTH=25 HEIGHT=25 ALT="">
<HR size=1 noshade width=600 align=left>
</TD>
</TR>
</TABLE>

</BODY></HTML>
